//
//  UnloadingAndHangBoxShowListVC.m
//  CJRailTransport
//
//  Created by Hank on 2018/1/15.
//  Copyright © 2018年 amplity. All rights reserved.
//

#import "UnloadingAndHangBoxShowListVC.h"
#import "UnloadingAndHangBoxShowListCell.h"
#import "UIButton+Expand.h"

@interface UnloadingAndHangBoxShowListVC ()

@end

@implementation UnloadingAndHangBoxShowListVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // 设置导航栏
    [self setNavC];
    // 设置界面属性
    [self setViewAttribute];
    // 设置BarButtonItem
    [self setBarButtonItem];
    // 注册Cell
    [self registerCells];
}

#pragma mark - 导航栏
- (void)setNavC
{
    self.title = @"确认集装箱";
    // 设置导航栏颜色
    BasicNavigationController *nVC = (BasicNavigationController *)self.navigationController;
    nVC.themeColor = [UIColor whiteColor];
    nVC.tintColor = [UIColor darkGrayColor];
}

// 设置界面属性
- (void)setViewAttribute
{
    self.view.backgroundColor = [UIColor whiteColor];
}

// 注册Cell
- (void)registerCells
{
    UINib *nib = [UINib nibWithNibName:[UnloadingAndHangBoxShowListCell reuseIdentifier] bundle:nil];
    [_myTableView registerNib:nib forCellReuseIdentifier:[UnloadingAndHangBoxShowListCell reuseIdentifier]];
}

// 设置BarButtonItem
- (void)setBarButtonItem
{
    UIButton *itemBtn = [UIButton setLeftOrRightButton:nil direction:@"right" title:@"提交"];
    [itemBtn addTarget:self action:@selector(rightItemAction) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:itemBtn];
}

#pragma mark - initArray
// 初始化数组
- (NSMutableArray *)containerDataArray
{
    if (!_containerDataArray) {
        _containerDataArray = [[NSMutableArray alloc]init];
    }
    return _containerDataArray;
}

#pragma mark - Action
// 提交 Action
- (void)rightItemAction
{
 
}

#pragma mark - TableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.containerDataArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UnloadingAndHangBoxShowListCell *cell = [tableView dequeueReusableCellWithIdentifier:[UnloadingAndHangBoxShowListCell reuseIdentifier] forIndexPath:indexPath];
    cell.indexPath = indexPath;
    [cell setData:self.containerDataArray];
    return cell;
}

#pragma mark - TableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
